<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      debugger
        var c='100';
        c;
        a();// 1
        console.log(a);// 1
      //   function a() {
      //   console.log("1");
      // }
      var a = function(y) {
        console.log(this)//window
        this.a2='a2'
        console.log("2");
      };

      function a(x) {
        console.log(this)//window
        this.a1='a1'
        console.log("1");
      }
     
      //如果方法和变量重名，变量会取代它
      a(); //2
      console.log(a);
    </script>
  </head>
  <body></body>
</html>
